package com.dhcc.bpm.modules.sandbox.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dhcc.bpm.common.text.Convert;
import com.dhcc.bpm.modules.sandbox.entity.CaseApiReturn;
import com.dhcc.bpm.modules.sandbox.mapper.CaseApiReturnMapper;
import com.dhcc.bpm.modules.sandbox.service.ICaseApiReturnService;
import com.dhcc.bpm.modules.sandbox.vo.CaseApiReturnVO;
import org.springframework.stereotype.Service;

/**
 * @ClassName CaseApiReturnServiceImpl
 * @Description 沙箱实例API返回码表 服务实现类
 * @Author sjm
 * @Date 2020/2/21 0021 15:16
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 **/
@Service
public class CaseApiReturnServiceImpl extends ServiceImpl<CaseApiReturnMapper, CaseApiReturn> implements ICaseApiReturnService {

	/**
	 * 自定义分页
	 * @Author sjm
	 * @Date 18:14 2020/2/21 0021
	 * @param page
	 * @param caseApiReturn
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.sandbox.vo.CaseApiReturnVO>
	 **/
	@Override
	public IPage<CaseApiReturnVO> selectCaseApiReturnPage(IPage<CaseApiReturnVO> page, CaseApiReturnVO caseApiReturn) {
		return page.setRecords(baseMapper.selectCaseApiReturnPage(page, caseApiReturn));
	}

	/**
	 * 查询实例接口列表
	 * @Author sjm
	 * @Date 18:14 2020/2/21 0021
	 * @param apiId
	 * @param caseId
	 * @return com.dhcc.bpm.modules.sandbox.vo.CaseApiReturnVO
	 **/
	@Override
	public CaseApiReturnVO selectCaseApi(Long apiId, Long caseId) {
		return baseMapper.selectCaseApi(apiId, caseId);
	}

	/**
	 * 批量删除
	 * @Author sjm
	 * @Date 18:15 2020/2/21 0021
	 * @param apiId
	 * @param caseId
	 * @param ids
	 * @return java.lang.Boolean
	 **/
	@Override
	public Boolean deleteCases(Long apiId, Long caseId, String ids) {
        return baseMapper.deleteCases(apiId,caseId,Convert.toLongArray(ids));
	}

}
